package com.hisan.freeride.common.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.hisan.freeride.R;


/**
 * 用户界面自定义标题主键
 * Created by Administrator on 2017/1/6.
 */
public class UserLinearLayout extends LinearLayout{
    private TextView classname;
    private ImageView icon,arrows;

    public UserLinearLayout(Context context) {
        super(context);
        // TODO Auto-generated constructor stub

    }
    public UserLinearLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        // TODO Auto-generated constructor stub
        LayoutInflater inflater=(LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(R.layout.user_interval, this);
        icon=(ImageView) findViewById(R.id.icon);
        classname=(TextView)findViewById(R.id.classname);
        arrows= (ImageView) findViewById(R.id.arrows);
    }

    /**
     * 获取图标
     * @return
     */
    public ImageView getIcon(){
        return icon;
    }
    /**
     * 获取分类名称
     * @return
     */
    public  TextView getClassname(){
        return classname;
    }

    /**
     * 获取箭头图标
     * @return
     */
    public ImageView getArrows(){
        return arrows;
    }

//    @Override
//    public void onClick(View view) {
//        switch (view.getId()){
//            case R.id.usercommunity:
//                break;
//            case R.id.userattention:
//                break;
//            case R.id.userissue:
//                break;
//            case R.id.useradvance:
//                break;
//        }
//        iCallbackListener.userclick(view.getId());
//    }
//
//    //自定义接口文件，click方法由调用处实现
//    public Interface ICallbackListener {
//        public void userclick(int id);
//    }
//    //初始化接口，由需要实现activity调用
//    public void setOnCallbackListener(ICallbackListener iCallbackListener) {
//        this.iCallbackListener = iCallbackListener;
//    }
}
